import CONSTANT from "../constant";
import Mat3 from "../common/mat3";
import Method from "../common/method";

export default class ShapeConfig {
    constructor(optional={}) {
        this.position = Method.convertVec3( optional.position);
        this.rotation = optional.rotation? new Mat3().fromQuat(Method.convertQuat(optional.rotation)):new Mat3();
        this.friction = optional.friction|| CONSTANT.SETTING_DEFAULT_FRICTION;
        this.restitution = optional.restitution|| CONSTANT.SETTING_DEFAULT_RESTITUTION;
        this.density = optional.density|| CONSTANT.SETTING_DEFAULT_DENSITY;
        this.collisionGroup = optional.collisionGroup|| CONSTANT.SETTING_DEFAULT_COLLISION_GROUP;
        this.collisionMask = optional.collisionMask|| CONSTANT.SETTING_DEFAULT_COLLISION_MASK;
        this.geometry = optional.geometry|| null;
        this.contactCallback = optional.contactCallback|| null;
    }
}